<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Fade In and Out from Bottom</title>
    <style>
        /* 页面居中 */
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f0f0f0;
        }

        /* 要实现渐入渐出效果的元素 */
        .fade-in-out {
            width: 200px;
            height: 100px;
            background-color: #007bff;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
            border-radius: 8px;
            /* 使用动画 */
            animation: fadeMove 3s ease-in-out infinite;
        }

        /* 渐入渐出动画 */
        @keyframes fadeMove {
            0% {
                opacity: 0;
                transform: translateY(20px);
                /* 从下方开始 */
            }

            50% {
                opacity: 1;
                transform: translateY(0);
                /* 到达正常位置 */
            }

            100% {
                opacity: 0;
                transform: translateY(-20px);
                /* 上移并消失 */
            }
        }
    </style>
</head>

<body>

    <div class="fade-in-out">Hello World</div>

</body>

</html>